package com.zc.angelica.controller;

import com.zc.angelica.entity.MenuButtonInfo;
import com.zc.angelica.entity.ResponseData;
import com.zc.angelica.service.MenuButtonInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@RestController
@RequestMapping("/menuButtonInfo")
public class MenuButtonInfoController {

    @Autowired
    private MenuButtonInfoService menuButtonInfoService;

    @PostMapping("/bindingButton")
    public ResponseData bindingButton(@RequestBody MenuButtonInfo menuButtonInfo) {
        return menuButtonInfoService.bindingButton(menuButtonInfo);
    }

    @GetMapping("/unbindingButton")
    public ResponseData unbindingButton(Long menuId, Long buttonId) {
        return menuButtonInfoService.unbindingButton(menuId,buttonId);
    }

    @GetMapping("/list")
    public ResponseData list() {
        return ResponseData.success(menuButtonInfoService.list());
    }

}
